package com.example.sellersale.server.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.sellersale.entity.Bill;
import com.example.sellersale.mapper.BillMapper;
import com.example.sellersale.server.BillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements BillService {
    @Autowired
    private BillMapper billMapper;
    @Override
    public List<Bill> userBillInfo(String userId) {
        return billMapper.userBillInfo(userId);
    }

    @Override
    public Bill pay(Bill bill) {
        int insert = billMapper.insert(bill);
        return insert==1?bill:null;
    }
}
